home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmInterest
- Caption = "7% Interest"
- ClientHeight = 1845
- ClientLeft = 1230
- ClientTop = 1770
- ClientWidth = 4005
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 1845
- ScaleWidth = 4005
- Begin VB.TextBox txtAmount
- Height = 285
- Left = 1920
- TabIndex = 1
- Top = 240
- Width = 1095
- End
- Begin VB.PictureBox picWhen
- Height = 255
- Left = 120
- ScaleHeight = 195
- ScaleWidth = 3675
- TabIndex = 3
- Top = 1440
- Width = 3735
- End
- Begin VB.CommandButton cmdYears
- Caption = "Years to become a millionaire"
- Default = -1 'True
- Height = 495
- Left = 120
- TabIndex = 2
- Top = 720
- Width = 3735
- End
- Begin VB.Label lblAmount
- Caption = "Amount Deposited"
- Height = 495
- Left = 960
- TabIndex = 0
- Top = 120
- Width = 975
- End
- Attribute VB_Name = "frmInterest"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdYears_Click()
- Dim balance As Single, numYears As Integer
- 'Compute years required to become a millionaire
- picWhen.Cls
- balance = Val(txtAmount.Text)
- numYears = 0
- Do While balance < 1000000
- balance = balance + 0.07 * balance
- numYears = numYears + 1
- Loop
- picWhen.Print "In"; numYears; "years you will have a million dollars."
- End Sub
-